<template>
  <base-breadcrumb :breadcrumb="!isAudit">
    <a-card
      v-if="$route.query.statusCode== 0||$route.query.statusCode== 1 ||$route.query.statusCode== 2||$route.query.statusCode== 3||$route.query.statusCode== 4 || dels.statusCode == '0'||dels.statusCode == '1'|| dels.statusCode == '2' || dels.statusCode == '3' "
      :bordered="false"
    >
      <title-name title="停工信息" />

      <a-row :gutter="24">
        <a-col
          :md="16"
          :sm="16"
        >
          <a-form-item
            label="所属项目"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.viewName"
              disabled
            />
          </a-form-item>
        </a-col>
        <!--        <a-col-->
        <!--          :md="8"-->
        <!--          :sm="8"-->
        <!--        >-->
        <!--          <a-form-item-->
        <!--            label="分公司"-->
        <!--            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"-->
        <!--            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"-->
        <!--          >-->
        <!--            <BaseInput-->
        <!--              v-model="dels.branchName"-->
        <!--              disabled-->
        <!--            />-->
        <!--          </a-form-item>-->
        <!--        </a-col>-->
        <!--        <a-col-->
        <!--          :md="8"-->
        <!--          :sm="8"-->
        <!--        >-->
        <!--          <a-form-item-->
        <!--            label="项目"-->
        <!--            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"-->
        <!--            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"-->
        <!--          >-->
        <!--            <BaseInput-->
        <!--              v-model="dels.projectName"-->
        <!--              disabled-->
        <!--            />-->
        <!--          </a-form-item>-->
        <!--        </a-col>-->
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="项目编号"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.projectNum"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="停工原因"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.reasonName"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="停工开始时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.downTime"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="预计重新开工时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.returnTime"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>

      <a-row :gutter="24">
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="创建人"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.creatorName"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="创建时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.createTime"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="24"
          :sm="24"
        >
          <a-form-item
            label="情况说明"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.descriptions"
              type="textarea"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>

      <title-name title="附件信息" />
      <!--<a-table bordered :pagination="false" :columns="columns" :data-source="data">-->
      <!--<span slot="serial" slot-scope="text, record, index">{{ index + 1 }}</span>-->
      <!--<span slot="action" slot-scope="text, record, index">-->
      <!--<a :href="'/api/ycloud-file-center/oper/download?access_token='+token+'&fileId='+record.fileId" target="_parent">导出</a>-->
      <!--</span>-->
      <!--</a-table>-->

      <u-table
        :list-url="listUrl"
        :req-method="reqMethod"
        :is-upload="false"
        :upload-list="uploadList"
        :business-id="businessId"
        business-code="PM13"
        :is-show="false"
      />

      <!--<title-name title="停工审批信息"></title-name>-->
      <!--todo-->
    </a-card>

    <a-card
      v-if="dels.statusCode == '3' || dels.statusCode == '4' "
      :bordered="false"
    >
      <title-name title="重新开工信息" />
      <a-row :gutter="24">
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="实际开工时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.applicantTime"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="申请人"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.applicantName"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="申请时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.applicantTime"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="24"
          :sm="24"
        >
          <a-form-item
            label="情况说明"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.restartDescriptions"
              type="textarea"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <!--<a-table bordered :pagination="false" :columns="columns" :data-source="dataStarts">-->
      <!--<span slot="serial" slot-scope="text, record, index">{{ index + 1 }}</span>-->
      <!--<span slot="action" slot-scope="text, record, index">-->
      <!--<a :href="'/api/ycloud-file-center/oper/download?access_token='+token+'&fileId='+record.fileId" target="_parent">导出</a>-->
      <!--</span>-->
      <!--</a-table>-->
      <u-table
        :list-url="listUrls"
        :req-method="reqMethod"
        :is-upload="false"
        :upload-list="uploadList"
        :business-id="businessId"
        :is-show="false"
      />
      <!--todo-->
    </a-card>

    <div class="page-btn-right-top">
      <!-- <div style="float:right;margin-top: 20px"> -->
      <a-button
        type="primary"
        @click="goBack"
      >
        关闭
      </a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
import Vue from 'vue'
import { STable, Ellipsis } from '@/components'
import { workStoppageApplyDetail } from '@/api/project/stopConstruction'

import ARow from 'ant-design-vue/es/grid/Row'

const columns = [
  {
    title: '序号',
    width: 65,

    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '附件名称',
    dataIndex: ' fileName'
  },
  {
    title: '附件格式',
    dataIndex: 'suffixName'
  },
  {
    title: '操作',
    dataIndex: 'action'
  }
]
const columnWbs = [
  {
    title: '序号',
    width: 65,
    dataIndex: 'index'
  },
  {
    title: '阶段/类别',
    dataIndex: 'name'
  },
  {
    title: '业务事项',
    dataIndex: 'businessMatters'
  },
  {
    title: '管控级别',
    dataIndex: 'level'
  },
  {
    title: '周期',
    dataIndex: 'duration'
  },
  {
    title: '计划开始时间',
    dataIndex: 'startTime'
  },
  {
    title: '计划结束时间',
    dataIndex: 'endTime'
  },
  {
    title: '前置任务',
    dataIndex: ''
  },
  {
    title: '间隔时间',
    dataIndex: ''
  },
  {
    title: '完成标准',
    dataIndex: 'completeStandard'
  },
  {
    title: '验证资料',
    dataIndex: 'verifyDoc'
  },
  {
    title: '第一责任人',
    dataIndex: 'firstResponsible'
  },
  {
    title: '直接责任人',
    dataIndex: 'responsible'
  }
]
export default {
  name: 'a' + Date.now(),
  components: {
    ARow
  },
  props: {
    isAudit: {
      // 是否作为审批详情
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      columns,
      columnWbs,
      visible: false,

      reqMethod: 'post',
      businessId: '',
      listUrl: '/cscec-project-business/project/shutdown/management/stoppage-fileQuery',
      listUrls: '/cscec-project-business/project/shutdown/management/resume-fileQuery',
      uploadList: '',

      data: [],
      dataStarts: [], // 重新开工附件

      dels: {
        viewName: ''
      }, // 获取分包商管理基本信息对象
      totalDels: {},
      queryParams: {},

      token: '',
      type: ''
    }
  },

  created() {
    this.id = this.$route.query.id
    this.businessId = this.$route.query.id
    this.type = this.$route.query.type

    this.getQuarterAssessmentOne()

    this.token = Vue.getAcloudProvider().getAccessToken()
  },
  computed: {},
  methods: {
    goBack() {
      // this.$router.push({path:'/stop-work/list'})
      if (this.type == 'approve') {
        window.close()
      } else {
        this.$multiTab.close(this.$route.fullpath)
      }
    },
    associateDetails() {
      this.visible = true
    },

    handCancel() {
      this.visible = false
    },
    getQuarterAssessmentOne() {
      workStoppageApplyDetail(this.id).then((res) => {
        this.dels = res.data
        this.dels.viewName = this.dels.branchName + '/' + this.dels.projectName
      })
    }
  }
}
</script>


